# -*- coding: utf-8 -*-

import asyncio

import aioredis


async def main():
    redis = aioredis.from_url("redis://:chench@localhost")
    await redis.set("my-key", "value")
    value = await redis.get("my-key")
    print(value)


if __name__ == "__main__":
    event_loop = asyncio.get_event_loop()
    event_loop.run_until_complete(main())
    # Python 3.7+
    # asyncio.run(main())
    pass
